package com.yjdb.sanyuantang.generator.source;

/**
 * @ClassName ConvertSqlType
 * @Description mysql数据类型转换成java类型
 * @Author 混沌酱
 * @Date 2023-08-09 11:21
 * @Version 1.0
 **/
public class ConvertSqlType {

    String sqlType;

    public  ConvertSqlType(String sqlType){
        this.sqlType=sqlType;
    }


    public String Convert(){
        sqlType=sqlType.toLowerCase();
        if (Utils.useList(ClassSqlCorrespondences.Integer.split(","),sqlType)){
            return "Integer";
        }else if (Utils.useList(ClassSqlCorrespondences.Double.split(","),sqlType)){
            return "Double";
        }else if (Utils.useList(ClassSqlCorrespondences.Float.split(","),sqlType)){
            return "Float";
        }else if (Utils.useList(ClassSqlCorrespondences.String.split(","),sqlType)){
            return "String";
        }else if (Utils.useList(ClassSqlCorrespondences.Double.split(","),sqlType)){
            return "Double";
        }else if (Utils.useList(ClassSqlCorrespondences.Long.split(","),sqlType)){
            return "Long";
        }else if (Utils.useList(ClassSqlCorrespondences.Date.split(","),sqlType)){
            return "Date";
        }
        else {
            return null;
        }
    }

}
